//function getStorageDetail(data){
//    parent.$.modalDialog.handler.dialog('close');
//    var options = {"id": data.object.paymentOrder.f_paidId};
//    editPayDetailFunction(options);
//}
//
//function editPayDetailFunction(newOptions) {
//    var options = {
//        "width": 980, "height": 600,
//        buttons: [{
//            id: "hongChongFunction",
//            text: '红冲',
//            handler: function () {
//                parent.$.modalDialog.openner_treeGrid = $("#dataGrid");//因为添加成功之后，需要刷新这个treeGrid，所以先预定义好
//            }
//        }, {
//            text: '返回',
//            handler: function () {
//                parent.$.modalDialog.openner_treeGrid = $("#dataGrid");
//                parent.$.modalDialog.handler.dialog('close');
//            }
//        }]
//    }
//    if (newOptions && newOptions.id) {
//        $.extend(options, newOptions);
//        editFun('付款明细', '/paymentOrder/payDetail.html?id=', $("#dataGrid"), options);
//    } else {
//        var select = $("#dataGrid").datagrid('getSelections');
//        if (select && select.length > 0) {
//            editFun('付款明细', '/paymentOrder/payDetail.html?id=', $("#dataGrid"), options);
//        } else {
//            parent.$.messager.alert('提示', '请选择一条数据.', 'info');
//        }
//    }
//}
//
//

function refreshStorageFileList(data){
    parent.$.modalDialog.handler.dialog('close');
    //if(parent.$.modalDialog&&parent.$.modalDialog.openner_treeGrid){
    //    parent.$.modalDialog.openner_treeGrid.datagrid('getPager').pagination('select');
    //}
    $.messager.alert("Info", "入库单保存成功", 'info');
}

function initTopStorageFileViewOrEditForm(options){
    var data = getStatusData("/storage/selectStorageSubList.html?storageId=" + $('#storageId').text());
    refreshStorageFileListPage(data, options);
}

//通过Data刷新入库单调整页面
function refreshStorageFileListPage(data, options){
    loadData(data.storage);
    $('#storageDate').datebox({
        required: true,
        editable: false
    });
    $('#storageStatus').text(data.storage.storageStatus);
    $('#storageDate').datebox("setValue", myformatter(new Date()));
    options.data =  data.storageSubs;
    $('#subItem').datagrid(options);
}

function changeStorageFileFunction(id){
    var options = {
        "width":980,"height":600,
        buttons: [{
            id: "cancelStorageDocSub",
            text: '撤销子项',
            handler: function () {
                parent.$.modalDialog.openner_treeGrid = $('#dataGrid');//因为添加成功之后，需要刷新这个treeGrid，所以先预定义好
            }
        },{
            id: "saveStorageDoc",
            text: '保存',
            handler: function () {
                parent.$.modalDialog.openner_treeGrid = $('#dataGrid');//因为添加成功之后，需要刷新这个treeGrid，所以先预定义好
            }
        },{
            text: '返回',
            handler: function () {
                parent.$.modalDialog.handler.dialog('close');
            }
        }]}
    if(id){
        options.id=id;
        editFun('查看入库单明细', '/storage/storageDocEdit.html?id=',$('#dataGrid'), options);
    }else{
        var select = $('#dataGrid').datagrid('getSelections');
        if (select&&select.length>0) {
            editFun('查看入库单明细', '/storage/storageDocEdit.html?id=',$('#dataGrid'), options);
        } else {
            parent.$.messager.alert('提示', '请选择一条数据.', 'info');
        }
    }


}